var t = new(require("../../../utils/http").HTTP);
Page({
  data: {
    selectArray: [{
      id: 1,
      text: "企业已在别处落地"
    }, {
      id: 2,
      text: "不满足园区入驻要求"
    }, {
      id: 3,
      text: "企业拿不到资质许可"
    }, {
      id: 4,
      text: "招商周期过长联系无效"
    }, {
      id: 5,
      text: "无法满足企业需求"
    }, {
      id: 6,
      text: "企业自身原因放弃"
    }, {
      id: 7,
      text: "因故重新录入"
    }, {
      id: 8,
      text: "误操作信息录错"
    }],
    sortType: 1,
    nowText: "企业已在别处落地",
    inputValue: ""
  },
  selectEvent: function (t) {
    this.setData({
      sortType: t.detail.selectedID,
      nowText: t.detail.nowText
    })
  },
  abandon: function (t) {
    this.setData({
      inputValue: t.detail.value
    })
  },
  formSubmit: function (a) {
    var e = this;
    if (this.data.inputValue) {
      var n = wx.getStorageSync("user");
      t.request({
          url: "https://www.qlsyyun.com:3000/abandon",
          header: {
            "Content-Type": "application/x-www-form-urlencoded"
          },
          method: "POST",
          data: {
            fqyy: e.data.inputValue,
            fqsj: e.data.nowtime,
            gxsj: e.data.nowtime,
            bID: e.data.bID
          }
        }).then((function (a) {
          t.request({
              url: "https://www.qlsyyun.com:3000/abandon/stjd",
              header: {
                "Content-Type": "application/x-www-form-urlencoded"
              },
              method: "POST",
              data: {
                khbh: e.data.infor.khbh,
                bm: n[1],
                qymc: e.data.infor.qymc,
                bID: e.data.bID,
                zsy: n[0],
                jd: "招商",
                khzt: "招商放弃",
                tname: n[0],
                cid: e.data.bID,
                tjsj: e.data.nowtime
              }
            }).then((function (t) {})),
            t.request({
              url: "https://www.qlsyyun.com:3000/abandon/zsgj",
              header: {
                "Content-Type": "application/x-www-form-urlencoded"
              },
              method: "POST",
              data: {
                gjnr: e.data.inputValue,
                lxr: e.data.infor.lxr,
                qymc: e.data.infor.qymc,
                gjsj: e.data.nowtime,
                bid: e.data.bID,
                xsjd: e.data.nowText,
                tname: n[0],
                tjsj: e.data.nowtime,
                bm: n[1],
                khbh: e.data.infor.khbh
              }
            }).then((function (t) {})),
            t.request({
              url: "https://www.qlsyyun.com:3000/abandon/stmx",
              header: {
                "Content-Type": "application/x-www-form-urlencoded"
              },
              method: "POST",
              data: {
                qymc: e.data.infor.qymc,
                bid: e.data.bID,
                tname: n[0],
                tjsj: e.data.nowtime,
                khbh: e.data.infor.khbh
              }
            }).then((function (t) {}))
        })),
        wx.showToast({
          title: "已放弃",
          icon: "none",
          duration: 1e3,
          mask: !0
        }),
        wx.navigateBack({
          delta: 1
        }),
        this.setData({
          hiddenmodalput: !0
        })
    } else
      wx.showToast({
        title: "请输入放弃原因",
        icon: "none",
        duration: 1e3,
        mask: !0
      })
  },
  quxiao: function () {
    wx.navigateBack({
      delta: 1
    })
  },
  onLoad: function (a) {
    var e = this,
      n = (new Date).getTime(),
      o = new Date(parseInt(n)).toLocaleString().replace(/年|月|日/g, "-").slice(0, 10).replace("上午", "").replace("下午", "").replace(/\//g, "-");
    e.setData({
        bID: a.bid,
        nowtime: o
      }),
      t.request({
        url: "https://www.qlsyyun.com:3000/information",
        data: {
          bID: e.data.bID
        }
      }).then((function (t) {
        e.setData({
          infor: t.data[0]
        })
      }))
  }
});